﻿
/// <reference path="http://localhost:666/Scripts/jquery-1.5-vsdoc.js" />
$(document).ready(function () {
    $.ajaxSetup({
        type: "POST",
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json"
    });

    var progresWondow = $('#progress');
    $(progresWondow).ajaxStart(function () { $(this).dialog({ modal: true, title: 'Proszę czekać..' }); });
    $(progresWondow).ajaxStop(function () { $(this).dialog('close'); });
    var error = $('#errorMessage');
    if (error == undefined) console.log('nie ma error message');
    //    $(error).ajaxError(function (f) { $(this).text(f); });

});

function ajax(_url, _data, _onSuccess) {

    var setting = {
        url: _url,
        success: _onSuccess,
    };

    if(_data!=null)
    {
    setting.data = _data;}
 
    $.ajax(setting);
}